package www.ld.com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import www.ld.com.domain.attr.group.pojo.AttrGroupPO;
import www.ld.com.domain.attr.group.query.AttrGroupQuery;
import www.ld.com.domain.attr.group.vo.AttrGroupVO;

import java.io.Serializable;
import java.util.Set;

public interface AttrGroupMapper extends BaseMapper<AttrGroupPO> {
    IPage<AttrGroupVO> pageAttrGroupByAttrGroupQuery(IPage<?> page, @Param("query") AttrGroupQuery query);

    /**
     * 从属性分组关联表中查询已关联属性
     * @param attrGroupId 属性分组Id
     * @return attrId
     */
    Set<String> findAttrIdByAttrGroupId(@Param("attrGroupId") Serializable attrGroupId);

    /**
     * 删除关联关系
     * @param attrGroupId 属性分组id
     * @param attrIds 属性分组
     */
    void delRelation(@Param("attrGroupId") Serializable attrGroupId,@Param("attrIds") Set<String> attrIds);

    /**
     * 新增关联关系
     * @param attrGroupId 属性分组id
     * @param attrIds 属性分组
     */
    void addRelation(@Param("attrGroupId") Serializable attrGroupId,@Param("attrIds") Set<String> attrIds);
}
